﻿using System;
using System.Collections.Generic;
 
using System.Text;

namespace GGSharp.Http
{
    public class RegisterAccountData : RetrievePasswordData
    {
        private string _email;
        private string _password;

        protected RegisterAccountData() { }

        public RegisterAccountData(string email, string password, string tokenID, string tokenValue)
        {
            _email = email;
            _password = password;
            TokenID = tokenID;
            TokenValue = tokenValue;
        }

        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }

        public override int Hash
        {
            get { return getHttpHash(Email + Password); }
        }

        public string Password
        {
            get { return _password; }
            set { _password = value; }
        }

        public override string QueryString
        {
            get
            {
                StringBuilder queryString = new StringBuilder();
                queryString.Append("pwd=");
                queryString.Append(Password);
                queryString.Append("&email=");
                queryString.Append(Email);
                queryString.Append("&tokenid=");
                queryString.Append(TokenID);
                queryString.Append("&tokenval=");
                queryString.Append(TokenValue);
                queryString.Append("&code=");
                queryString.Append(Hash);
                return queryString.ToString();
            }
        }

        public override void Read(System.IO.StreamReader reader)
        {
            throw new NotImplementedException();
        }
    }
}
